package seminar.evaluate;

import seminar.LectureEvent;
import seminar.Semester;

/**
 * Evaluate if mornings or noons are free
 * @author Johannes Degler
 *
 */
public class MorningOrNoonFreeEvaluator implements IEvaluator{

	@Override
	public int getPoints(final Semester semester) {
		boolean morningFree = true;
		boolean noonFree = true;

		for(int day = 0; day < 5; day++)
			for(int slot = 0; slot < 6; slot++){
				final LectureEvent event = semester.getEvents()[day][slot];
				if(event != null)
					if(slot < 3 && morningFree)
						morningFree = false;
					else if(slot >= 3 && noonFree)
						noonFree = false;
			}

		if(morningFree && noonFree) //Free days are already covered in LecturesPerDayEvaluator
			return 0;
		else if(morningFree)
			return 15;
		else if(noonFree)
			return 20;

		return 0;
	}

}
